<%@ page import="java.util.Date" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page errorPage="/WEB-INF/errorPage.jsp" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>订单详细</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <style type="text/css">
        * {
            font-size: 11pt;
        }

        div {
            border: solid 2px gray;
            width: 75px;
            height: 75px;
            text-align: center;
        }

        li {
            margin: 10px;
        }

        #pay {
            background: url(<c:url value='/images/all.png'/>) no-repeat;
            display: inline-block;

            background-position: 0 -412px;
            margin-left: 30px;
            height: 36px;
            width: 146px;
        }

        #pay:HOVER {
            background: url(<c:url value='/images/all.png'/>) no-repeat;
            display: inline-block;

            background-position: 0 -448px;
            margin-left: 30px;
            height: 36px;
            width: 146px;
        }
    </style>
</head>

<body>
<h1>当前订单</h1>

<table border="1" width="100%" cellspacing="0">
    <tr bgcolor="gray" bordercolor="gray">
        <c:set var="sumprice" value="0"/>
        <c:forEach var="cartItem" items="${carts.cartItems}">
            <c:set var="sumprice" value="${cartItem.value.bcount * cartItem.value.book.price + sumprice}"/>
        </c:forEach>
        <td colspan="6">
            订单编号：123456　成交时间：2000-01-01 15:30　金额：<font color="red"><b><c:out value="${sumprice}"/></b></font>
        </td>
    </tr>

    <c:forEach var="cartItem" items="${carts.cartItems}">
        <c:if test="${cartItem.key!=null}">
            <tr bordercolor="gray" align="center">
                <td width="15%">
                    <div><img src="<c:url value='/${cartItem.value.book.image}'/>" height="75"/></div>
                </td>
                <td>书名：${cartItem.value.book.bname}</td>
                <td>单价：${cartItem.value.book.price}</td>
                <td>作者：${cartItem.value.book.author}</td>
                <td>数量：${cartItem.value.bcount}</td>
                <td>小计：<fmt:formatNumber maxFractionDigits="2" pattern="0.00"
                                         value="${cartItem.value.bcount * cartItem.value.book.price}"/></td>

                    <%--<c:set var="orderName" value="${cartItem.value.book.bname}"/>--%>
            </tr>
        </c:if>
    </c:forEach>


</table>
<br/>
<form method="post" action="/order" id="form" target="_parent">
    <%
        Date date = new Date();
        long time = date.getTime();
        request.setAttribute("time", time);
    %>
    <input type="hidden" name="WIDout_trade_no" value="${time}">
    <input type="hidden" name="WIDtotal_amount" value="${sumprice}">
    <input type="hidden" name="WIDsubject" value="蓝鸥书城购买图书">
    <input type="hidden" name="WIDbody" value="测试">
    收货地址：<input type="text" name="address" size="50" value="北京市海淀区金燕龙大厦2楼216室无敌收"/><br/>

    选择银行：<br/>
    <input type="radio" name="pd_FrpId" value="ICBC-NET-B2C" checked="checked"/>支付宝支付
    <img src="../../bank_img/alipay.png" align="middle"/>
    <%--<input type="radio" name="pd_FrpId" value="BOC-NET-B2C"/>中国银行--%>
    <%--<img src="../../bank_img/bc.bmp" align="middle"/><br/><br/>--%>
    <%--<input type="radio" name="pd_FrpId" value="ABC-NET-B2C"/>农业银行--%>
    <%--<img src="../../bank_img/abc.bmp" align="middle"/>--%>
    <%--<input type="radio" name="pd_FrpId" value="CCB-NET-B2C"/>建设银行--%>
    <%--<img src="../../bank_img/ccb.bmp" align="middle"/><br/><br/>--%>
    <%--<input type="radio" name="pd_FrpId" value="BOCO-NET-B2C"/>交通银行--%>
    <%--<img src="../../bank_img/bcc.bmp" align="middle"/><br/>--%>
</form>
<a id="pay" href="javascript:document.getElementById('form').submit();"></a>

</body>
</html>

